//
//  UIView+CreateUtils.m
//  基本框架
//
//  Created by runone02 on 2018/8/17.
//  Copyright © 2018年 liqiyun. All rights reserved.
//

#import "UIView+CreateUtils.h"

@implementation UIView (CreateUtils)

#define tcolor LTTitleColor

- (UIButton *)btnF:(CGRect)frame title:(NSString *)title fsize:(CGFloat)fsize{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = frame;
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    btn.titleLabel.font = [UIFont systemFontOfSize:fsize];
    return btn;
}

- (UILabel *)labF:(CGRect)frame text:(NSString *)text fsize:(CGFloat)fsize{
    UILabel *label = [[UILabel alloc]init];
    label.frame = frame;
    label.backgroundColor = [UIColor clearColor];
    label.text = text;
    label.textAlignment = NSTextAlignmentLeft;
    label.numberOfLines = 0;
    label.textColor = [UIColor blackColor];
    label.font = [UIFont systemFontOfSize:fsize];
    return label;
}

- (UIImageView *)imgF:(CGRect)frame imgName:(NSString *)name{
    UIImageView *imgV = [[UIImageView alloc]init];
    if (name.length > 0) {
        imgV.image = IMAGE(name);
    }
    imgV.frame = frame;
    return imgV;
}

- (UIView *)lineF:(CGRect)frame{
    UIView *line = [[UIView alloc]init];
    line.frame = frame;
    line.backgroundColor = [UIColor grayColor];
    return line;
}
@end
